// pages/newPageBankrecate/newPageBankrecate.js
var app = getApp();
var com = require('../../common.js');
Page({
  data: {
    userName: ''
  },
  onLoad: function (options) {
    var _this = this,
      name = options.name
    _this.setData({
      userName: name
    })
  },
  onReady: function () {},
  onShow: function () {},
  onHide: function () {},
  onUnload: function () {},
  onPullDownRefresh: function () {},
  onReachBottom: function () {},
  onShareAppMessage: function () {},
  //提交信息
  onPageCententServer(e) {
    var _this = this,
      value = e.detail.value
    console.log(value)
    com.link(app.link.onBankUserState, value, function (res) {
      console.log(res)
      if (res.data.state) {
        wx.navigateTo({
          url: '/pages/onPagesIndex/onPagesIndex',
        })
      } else {
        wx.showModal({
          title: '温馨提示',
          content: res.data.message,
          showCancel: false,
          success(res) {
            if (res.confirm) {
              wx.navigateBack({
                delta: 1,
              })
            }
          }
        })
      }

    })

  }
})